﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using QualityRpt.Utils;

namespace QualityRpt.Dao
{
    interface ITransNoteDao
    {
        /// <summary>
        /// 装载原始数据
        /// </summary>
        DataSet LoadRawData(DateTime startTime, DateTime endTime, string entry_zh, string entry_zh_msg,
            string entry_special, string entry_special_msg, string exit_zh, string exit_zh_msg,
            string exit_special, string exit_special_msg);
        DataSet StatRawData(DateTime startTime, DateTime endTime);
        /// <summary>
        /// 抽取原始数据到trans_note(四张表合成一张) v2
        /// 0 成功
        /// -1 有数据未成功插入
        /// 装入的行数，拒绝的行数，
        /// </summary>
        /// <param name="from_time">数据开始抽取的时间</param>
        /// <param name="row_count">插入到整合表的行数</param>
        void ExtractData(DateTime startTime, DateTime endTime, out string msg);
        /// <summary>
        /// 从交易表抽取数据到低电和防拆卸筛选表 v2
        /// </summary>
        /// <param name="aff_count"></param>
        void ExtractLbTamp(DateTime startTime, DateTime endTime,out string msg);
        /// <summary>
        /// 抽取电子标签和IC卡的关联关系数据
        /// 增量更新 但是会删除最后交易时间在重新统计的时间段内的关联关系 v2
        /// </summary>
        /// <param name="startTime"></param>
        /// <param name="endTime"></param>
        void ExtractOBUCardRel(DateTime startTime, DateTime endTime, out string msg);
        //按日统计
        void StatOBUByDay(DateTime startTime, DateTime endTime, out string msg);
        void StatAIRByDay(DateTime startTime, DateTime endTime, out string msg);
        void StatCARDByDay(DateTime startTime, DateTime endTime, out string msg);
        #region 最新版智能统计
        /// <summary>
        /// IC卡综合查询包含代码集分组
        /// </summary>
        DataTable GetCARDStatByQ(DateTime startTime, DateTime endTime, int statTType, string spin, string specin, string cnin,
            string rdin, string plazain, string lanein, bool fromTemp, string[] numstartArray, string[] numendArray);
        /// <summary>
        /// 标签综合统计不包含代码集分组
        /// 交易个数统计
        /// </summary>
        DataTable GetOBUDsStatByQ(DateTime startTime, DateTime endTime, int statTType, string spin, string specin, string cnin,
            string rdin, string plazain, string lanein, bool fromTemp, string[] numstartArray, string[] numendArray);
        /// <summary>
        /// <summary>
        /// 标签综合统计包含代码集分组
        /// 交易次数统计
        /// </summary>
        DataTable GetOBUTrStatByQ(DateTime startTime, DateTime endTime, int statTType, string spin, string specin, string cnin,
            string rdin, string plazain, string lanein, bool fromTemp, string[] numstartArray, string[] numendArray);
        /// <summary>
        /// 天线综合查询包含代码集分组
        /// </summary>
        DataTable GetAIRStatByQ(DateTime startTime, DateTime endTime, int statTType, string spin, string specin,string rdin, string plazain, string lanein);
        /// <summary>
        /// 依据obu列表获取obu分组明细
        /// </summary>
        DataTable GetOBUGDetailByQ(DateTime startTime, DateTime endTime, string obuin, string rdin, string plazain, string lanein);
        /// <summary>
        /// 获取以天线(广场车道)分组的明细
        /// </summary>
        DataTable GetAIRGDetailByQ(DateTime startTime, DateTime endTime, string plazain, string lanein);
        #endregion
		/// <summary>
		/// 获得军车统计信息
		/// </summary>
		DataTable GetJZTBG (DateTime startTime, DateTime endTime);
		/// <summary>
		/// 获得4张原始表的最后交易时间
		/// </summary>
		/// <returns>The raw max time.</returns>
		DateTime[] GetRawMaxTime ();
		/// <summary>
		/// 获取4张原始表的最早交易时间
		/// </summary>
		/// <returns>The raw minimum time.</returns>
		DateTime GetRawMinTime();
    }
}
